import apis from "../../http/apis"

export default {
    namespaced:true,
    state:{
        admins:{
            account:'',
            password:''
        }
    },
    actions:{
        //管理员登录
        async adminsLogin(context){
            const {data} = await apis.admins.adminsLogin({
                ...context.state.admins
            })
            console.log(data);
            if(data.status){
                alert(data.message)
                localStorage.token = data.token
                location.hash = '#/adminsSystem'
            }else{
                alert(data.message)
            }
        }
    }
}